package com.bwie.service.impl;

import com.bwie.common.domain.Role;
import com.bwie.common.domain.User;
import com.bwie.common.domain.request.UserRequest;
import com.bwie.common.result.Result;
import com.bwie.mapper.UserMapper;
import com.bwie.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @className: UserServiceImpl
 * @Description: TODO
 * @version: v1.８.0
 * @author: 张雨乐
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    public Result<User> userLogin(UserRequest userRequest) {
        return Result.success(userMapper.userLogin(userRequest));
    }

    @Override
    public Result<List<Role>> getRole(Integer id) {
        return Result.success(userMapper.getRole(id));
    }

    @Override
    public Result<List<User>> getUser() {
        List<User>userList=userMapper.getUser();
        return Result.success(userList);
    }
}
